package org.lex.pci.ch02.similarity;

import org.lex.pci.ch02.data.Preferences;
import org.lex.pci.ch02.data.Users;

public class SimilarityAlgorithmTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		SimilarityAlgorithm euclidean = new EuclideanDistanceSimilarityAlgorithm();
		SimilarityAlgorithm pearson = new PearsonSimilarityAlgorithm();

		testSimilarity(euclidean, Users.LISA_ROSE, Users.GENE_SEYMOUR);
		testSimilarity(pearson, Users.LISA_ROSE, Users.GENE_SEYMOUR);
	}

	public static void testSimilarity(SimilarityAlgorithm algorithm, String person1, String person2) {
		double distance = algorithm.getSimilarity(Preferences.getInstance(), person1, person2);
		System.out.println(algorithm.getName() + " [" + person1 + ", " + person2 + "]: " + distance);
	}
}
